package com.xqiapp;

import org.apache.log4j.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;

import java.util.concurrent.CountDownLatch;


@SpringBootApplication
@ImportResource({"classpath:dubbo-server.xml"})
public class WebxApiServerApplication {

	private static final Logger LOG = Logger.getLogger(WebxApiServerApplication.class);

	@Bean
	public CountDownLatch closeLatch() {
		return new CountDownLatch(10);
	}

	public static void main(String[] args) throws InterruptedException {
		ApplicationContext ctx = SpringApplication.run(WebxApiServerApplication.class, args);
		LOG.info("项目启动!");
		CountDownLatch closeLatch = ctx.getBean(CountDownLatch.class);
		closeLatch.await();
	}
}
